package nku.csc360;
// Function for Part1 of the homework

public class part1 {
		// Constants for maximum amount of Streets and Avenues
		public static final int MAXSTREET = 7;
		public static final int MAXAVENUE = 8;
	
		//Method for counting no. of shortest routes 
		static int CountPaths(int IkeStreet, int IkeAvenue){
			//Initializing variables for counting number of paths
			int pathA;
			int pathB;
			int count = 1;
			// This first if statement is for error checking purposes
			if (IkeStreet > MAXSTREET || IkeAvenue > MAXAVENUE){
				System.out.println("You have chosen incorrect Street or Avenue Numbers. ");
				return -1;
			}
			// Base Case only when one path can be taken
			else if(IkeStreet == 1 || IkeAvenue == 1){
				return count;
			}
			// Case if more then one path can be taken
			else if(IkeStreet != 1 && IkeAvenue != 1){
				pathA = CountPaths(IkeStreet - 1,IkeAvenue);
				pathB = CountPaths(IkeStreet, IkeAvenue - 1);
				count = pathA + pathB;
				return count;
			}
			//I needed this method because i am returning an int and 
			//the compiler is throwing an error because it thinks
			//I might not be returning an int if it doesn't go into the loops.
			//I could of took care of it by having the previous else if st. as an 
			// else but i just wanted to have it like that. 
			else {
				System.out.println("There was some kind of error!!!!");
				return -1;
				
			}
		}
	}
